<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LENSTAR-标签</title>
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="../static/css/myStyle.css">
</head>
<body>
    <!--导航栏-->
    <nav id="nav" th:replace="_fragments :: menu(3)" class="gird-header">
        <div class="ui container">
            <div class="ui inverted secondary stackable menu">
                <h2 class="ui olive header item" style="font-family: STSong">LENSTAR</h2>
                <!--<div class="right m-item item m-mobile-hide">-->
                <a href="./index.html" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
                <a href="./types.html" class="m-item item m-mobile-hide"><i class="clone outline icon"></i>分类</a>
                <a href="./tags.html" class="active m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
                <a href="./archives.html" class="m-item item m-mobile-hide"><i class="align justify icon"></i>归档</a>
                <a href="about.html" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>
                <!--</div>-->
                <div class="m-item right item m-mobile-hide">
                    <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                        <div class="ui icon transparent inverted input">
                            <input type="text" name="query" placeholder="Search...." value="" th:value="${query}">
                            <i class="search link icon"></i>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <a href="#" class="ui menu toggle button m-right-top m-mobile-show"
           style="background-color: rgba(0,0,0,0); color: gainsboro">
            <i class="sidebar icon"></i>
        </a>
    </nav>

    <br>
    <br>
    <br>
    <br>
    <!--中间内容-->
    <div class="m-padded-tb-large">
        <div class="ui container m-opacity">
            <div class="ui stackable grid m-container-small">
                <!--header-->
                <div class="ui top attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <h3 class="ui teal header">标签</h3>
                        </div>
                        <div class="right aligned column">
                            共 <h3 class="ui orange header m-inline-block m-text-thin" th:text="${#arrays.length(tags)}">14</h3> 个
                        </div>
                    </div>
                </div>
                <!--标签列表-->
                <div class="ui segment m-padded-lr-clear" style="width: 100%">
                    <div class="ui labeled button m-margin-tb-tiny" th:each="tag : ${tags}">
                        <a href="" th:href="@{/tags/{id}(id=${tag.id})}" class="ui basic button" th:classappend="${tag.id==activeTagId} ? 'teal'" th:text="${tag.name}">MySQL</a>
                        <div class="ui basic left pointing label" th:classappend="${tag.id==activeTagId} ? 'teal'" th:text="${#arrays.length(tag.blogList)}">23</div>
                    </div>
                </div>
                <!--content-->
                <div class="ui padded segment m-padded-tb-large" th:each="blog : ${pageInfo.list}">
                    <div class="ui middle alined mobile reversed stackable grid">
                        <div class="eleven wide column">
                            <h3 class="ui header" th:text="${blog.title}">Java从入门到放弃</h3>
                            <p class="m-text" th:text="${blog.description}">本文将从服务器购买后远程连接，环境搭建，项目部署运行和域名访问来讲述SpringBoot搭建个人博客的线上部署，每一个步骤都有详细的说明，这一篇结束后，【SpringBoot搭建个人博客】所有功能都已完成，可以进行访问了......</p>
                            <div class="ui grid">
                                <div class="eleven wide column">
                                    <div class="ui horizontal link list">
                                        <div class="item">
                                            <img src="../static/images/avatar.jpg" th:src="@{${blog.avatar}}"  alt="" class="ui avatar image">
                                            <div class="content"><a href="" th:href="@{/about}" class="header">LENSTAR</a></div>
                                        </div>
                                        <!--createTime-->
                                        <div class="item">
                                            <i class="calendar icon"></i><span th:text="${#dates.format(blog.createTime,'yyyy-MM-dd')}">2020-07-20</span>
                                        </div>
                                        <!--views-->
                                        <div class="item">
                                            <i class="eye icon"></i> <span th:text="${blog.views}">123</span>
                                        </div>
                                        <!--comment_count-->
                                        <div class="item">
                                            <i class="comment outline icon"></i> <span th:text="${blog.commentCount}">8</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="right aligned five wide column">
                                    <a href="#" target="_blank" class="ui teal label basic m-padded-mini m-text-thin" th:text="${blog.typeName}">认知升级</a>
                                </div>
                            </div>
                        </div>

                        <div class="five wide column">
                            <a href="#" th:href="@{/blog}" target="_blank">
                                <img src="" th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image">
                            </a>
                        </div>
                    </div>
                </div>
                <!--footer 分页-->
                <div class="ui bottom attached segment">
                    <div class="ui middle aligned three column grid">
                        <div class="column">
                            <a href="#" th:href="@{/(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}" class="ui mini teal basic button">上一页</a>
                        </div>
                        <div class="center aligned column" align="center">
                            <p> <span th:text="${pageInfo.pageNum}"></span> / <span th:text="${pageInfo.pages}"></span> </p>
                        </div>
                        <div class="right aligned column">
                            <a href="#" th:href="@{/(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}" class="ui mini teal basic button">下一页</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--底部栏-->
    <footer th:replace="_fragments :: footer" class="ui inverted vertical m-padded-tb-massive">
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">
                <div class="four wide column">
                    <img src="../static/images/wechat.jpg" alt="" style="width: 100px;">
                </div>
                <div class="four wide column">
                    <h4 class="ui inverted header m-text-spaced m-text-thin">最新博客</h4>
                    <div class="ui inverted link list">
                        <a href="" class="item">Java（User Story）</a>
                        <a href="" class="item">Linux（User Story）</a>
                        <a href="" class="item">Redis（User Story）</a>
                    </div>
                </div>
                <div class="four wide column">
                    <h4 class="ui inverted header m-text-spaced m-text-thin">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="" class="item">邮箱：XX181028@163.com</a>
                        <a href="" class="item">QQ：1412265423</a>
                    </div>
                </div>
                <div class="four wide column">
                    <h4 class="ui inverted header m-text-spaced m-text-thin">LENSTAR</h4>
                    <p class="m-text-spaced m-text-thin m-opacity-mini" style="color: gainsboro">
                        这是我的个人博客，会分享我所学到的任何知识，希望和大家一起共同进步.....
                    </p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-spaced m-text-thin m-opacity-mini" style="color: gainsboro">
                Copyright © 2020-2021 LENSTAR Designed by LENSTAR
            </p>
        </div>
    </footer>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script>
        // 点击按钮触发事件
        $('.menu.toggle').click(function () {
            $('.m-item').toggleClass('m-mobile-hide');
        });

        // 最新博客
        function newBlog() {
            $.get({
                url:/*[[@{/newBlog}]]*/"/newBlog",
                success:function (data) {
                    //这里的data是后台传来的数据
                    document.getElementById("newBlog-1").innerText = data[0].title;
                    document.getElementById("newBlog-2").innerText = data[1].title;
                    document.getElementById("newBlog-3").innerText = data[2].title;
                    document.getElementById("newBlog-1").href = "/blog/"+data[0].id;
                    document.getElementById("newBlog-2").href = "/blog/"+data[1].id;
                    document.getElementById("newBlog-3").href = "/blog/"+data[2].id;
                }
            });
        }
        newBlog();
    </script>
</body>
</html>